package com.zhongyu.controller;

import com.zhongyu.service.LinkUserService;
import com.zhongyu.vo.ResultVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/sys/client/")
public class LinkUserController {
    @Resource
    private LinkUserService linkUserService;
    @GetMapping("/list")
    public ResultVo list(){
        return ResultVo.success( linkUserService.searchAll()) ;
    }


    @GetMapping("/del")
    public ResultVo del(Integer id) {
        try {
            linkUserService.del(id);
            return ResultVo.success("删除员工成功!");
        } catch (Exception ex) {

            return ResultVo.failure("删除员工失败！", ex);
        }


    }

}
